package com.cheer.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.cheer.entity.MallImageEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 图片表
 * 
 * @author cheer
 */
@Mapper
@Repository
public interface MallImageDao extends BaseMapper<MallImageEntity> {

    default List<MallImageEntity> listByType(Integer type){
        return selectList(new QueryWrapper<MallImageEntity>().eq("image_type", type)
                .eq("show_status", true)
                .orderByAsc("sort"));
    }
}
